#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <list>
#include <pthread.h>

#define PORTNUM 	23000
#define MAX_USR_ID_LEN 	20
#define MAX_USR_NUM 	30

typedef struct{
	bool		active;
	char 		name[MAX_USR_ID_LEN];
	pthread_t	thread_id;
	int 		sock_id;
}usr_info;

#ifdef SERVER_LISTERNER

std::list<int>		sock_list;
usr_info		usr[MAX_USR_NUM];
int 			usr_num;
pthread_mutex_t		usr_lock;

int 	add_usr_info(char *, char *);
void 	*server_listener(void *);

#else

extern std::list<int>		sock_list;
extern usr_info			usr[MAX_USR_NUM];
extern int 			usr_num;
extern pthread_mutex_t		usr_lock;

extern int 	add_usr_info(char *, char *);
extern void 	*server_listener(void *);

#endif
